package de.fhb.formel1.dbhibernate.persistence;

// Generated 14.01.2010 11:25:02 by Hibernate Tools 3.2.2.GA

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Rennstrecke generated by hbm2java
 */
@Entity
@Table(name = "Rennstrecke")
public class Rennstrecke implements java.io.Serializable {

	private Integer streckenId;
	private Land land;
	private String name;
	private Set<Rennen> rennen = new HashSet<Rennen>(0);

	Rennstrecke() {
	}

	public Rennstrecke(Land land, String name) {
		this.land = land;
		this.name = name;
	}

	public Rennstrecke(Land land, String name, Set<Rennen> rennen) {
		this.land = land;
		this.name = name;
		this.rennen = rennen;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "StreckenID", unique = true, nullable = false)
	public Integer getStreckenId() {
		return this.streckenId;
	}

	private void setStreckenId(Integer streckenId) {
		this.streckenId = streckenId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "LandID", nullable = false)
	public Land getLand() {
		return this.land;
	}

	public void setLand(Land land) {
		this.land = land;
	}

	@Column(name = "Name", nullable = false, length = 40)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "rennstrecke")
	public Set<Rennen> getRennen() {
		return this.rennen;
	}

	public void setRennen(Set<Rennen> rennen) {
		this.rennen = rennen;
	}

}
